#include "PacketTypeFilter.h"



inline PacketTypeFilter::PacketTypeFilter(const std::type_info& ti) : 
	packetType(&ti)
{ 
	assert(packetType); 
}

inline bool PacketTypeFilter::before(const PacketTypeFilter& rhs) const
{
	assert(packetType);
	return packetType->before(*rhs.packetType) != 0;
}

inline const std::type_info& PacketTypeFilter::Get() const
{
	assert(packetType);
	return *packetType;
}

inline const char* PacketTypeFilter::name() const
{
	assert(packetType);
	return packetType->name();
}

bool PacketTypeFilter::accept(Packet * packet) {
    return *packetType == typeid(*packet);
}


std::string PacketTypeFilter::toString() {
	return std::string("PacketTypeFilter: ") + packetType->name();
}
